<?php
include_once '../web_inc.php';
//include_once './check_login.php';    //权限验证文件，正式环境下必须开启！！！
include_once ROOT_PATH.'/config/db_conn.php';
include_once 'inc/gy_info_class.php';



$fen=new getInfo_gy();

$fenlei_id=$_GET[class_id];
        
		/*下面的获取记录仅为分类选择使用*/
        $class_arr=array();
		$query = mysql_query("select * from gy_class order by sort asc, id Desc");
		while($row =mysql_fetch_array($query)){
			$class_arr[] = array($row['id'],$row['name'],$row['up'],$row['sort']);
		}
       /*end*/

?>

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>信息发布</title>
	<link rel="stylesheet" href="../form/jqtransformplugin/jqtransform.css" type="text/css" media="all" />
	<script type="text/javascript" src="../form/requiered/jquery.js" ></script>
	<script type="text/javascript" src="../form/jqtransformplugin/jquery.jqtransform.js" ></script>
	<script type="text/javascript" src="../form/j.js" ></script>

	<link rel="stylesheet" href="../editor/themes/default/default.css" />
	<link rel="stylesheet" href="../editor/plugins/code/prettify.css" />
	<script charset="utf-8" src="../editor/kindeditor.js"></script>
	<script charset="utf-8" src="../editor/lang/zh_CN.js"></script>
	<script charset="utf-8" src="../editor/plugins/code/prettify.js"></script>
	<script charset="utf-8" src="../editor/text.js"></script>
</head>

<body>

<form name='form1' id='myupload' action='post_ok.php?action=post_gy' method="post" enctype='multipart/form-data'>
	<table border="0" width="600px" id="table1" align=center>
		<tr>
			<td>信息标题：</td>
			<td><input type="text" name="title" size="20"></td>
		</tr>
		<tr>
			<td>选择类别：</td>
			<td><select name="class" id="up"><?php dafenglei_select(0,0,$fenlei_id);?></select></td>
		</tr>
		<tr>
			<td>新旧程度：</td>
			<td>
	         	<table border="0" width="480px" id="table1" align=left>
	              <tr>
		             <td><input type="radio" name="xj" value="全新">全新</td>
		             <td> <input type="radio" name="xj" value="九成新">九成新</td>
					 <td><input type="radio" name="xj" value="八成新">八成新</td>
					 <td><input type="radio" name="xj" value="七成新">七成新</td>
					 <td><input type="radio" name="xj" value="七成新以下">七成新以下</td>
	              </tr>
              </table>
			</td>
		</tr>
		<tr>
			<td>价&nbsp;&nbsp;&nbsp; 格：</td>
			<td><input type="text" name="price" size="20"></td>
		</tr>
		<tr>
			<td>图&nbsp;&nbsp;&nbsp; 片：</td>
			<td><input name="img" type="hidden" id=img value="" />
		<input name="img_thumb" type="hidden" id="img_thumb" value="" />
<iframe src="upload.php?action=add&imgsize=1&img_w=500&img_h=400" width="100%" height="80" scrolling="No" frameborder="0" style="border:0px;"></iframe>
            </td>
		</tr>
		<tr height=20px>
			<td>有 效 期：</td>
			<td>
	         	<table border="0" width="300px" id="table1" align=left>
	              <tr>
		             <td><input type="radio" name="lasttime" checked value="3">3天</td>
		             <td><input type="radio" name="lasttime" value="7">7天</td>
					 <td><input type="radio" name="lasttime" value="15">15天</td>
					 <td><input type="radio" name="lasttime" value="30">30天</td>
	              </tr>
              </table>
            </td>
		</tr>
		<tr>
			<td valign=top>详细说明：</td>
			<td><textarea name="content1" style="width:500px;height:200px;visibility:hidden;"></textarea></td>
		</tr>
		<tr>
			<td>　</td>
			<td>　</td>
		</tr>
		<tr>
			<td>所属院校：</td>
			<td>　</td>
		</tr>
		<tr>
			<td>QQ:</td>
			<td><input type="text" name="qq" size="20"></td>
		</tr>
		<tr>
			<td>手&nbsp;&nbsp;&nbsp; 机：</td>
			<td><input type="text" name="tel" size="20"></td>
		</tr>
		<tr>
			<td>　</td>
			<td>　</td>
		</tr>
		<tr>
			<td colspan="2" align="center"><input type="submit" value="提交" name="B1"></td>
		</tr>
	</table>
</form>


<?php

function dafenglei_select($m,$id,$index)
{	
	global $class_arr;
	$n = str_pad('',$m,'-',STR_PAD_RIGHT);
	$n = str_replace("-","&nbsp;&nbsp;",$n);
	for($i=0;$i<count($class_arr);$i++){
	
		if($class_arr[$i][2]==$id){
			if($class_arr[$i][0]==$index){
				echo "        <option value=\"".$class_arr[$i][0]."\" selected=\"selected\">".$n."|--".$class_arr[$i][1]."</option>\n";
			}else{
				echo "        <option value=\"".$class_arr[$i][0]."\">".$n."|--".$class_arr[$i][1]."</option>\n";
			}
			dafenglei_select($m+1,$class_arr[$i][0],$index);
			
		}
		
	}
	
}
?>